<?
   require_once('config.php');
   $keyword = getValue('q','str','GET','');
   $db_query = new db_query(" SELECT 
                                 per_id,per_name
                              FROM 
                                 person
                              WHERE
                                 per_name LIKE'%" . $keyword . "%'"
                              );
   $array_per  = $db_query->resultArray();
   unset($db_query);
   $arr_result = array();
   if(count($array_per) > 0){
      foreach($array_per as $value){
         $arr_result[] = array('id' => $value['per_id'],'name' => $value['per_name']);
      }
   }   
   echo json_encode($arr_result);
?>